package com.jdl.iscm.page;

import com.jdl.iscm.advise.Sleep;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.springframework.stereotype.Component;

/**
 * @Author: Ran
 * @Date: 2021/8/16
 **/
@Component
public class LoginPage {

    /**
     * 登录组件
     *
     * @param webDriver
     * @param username
     * @param password
     */
    @Sleep
    public void loginComponent(WebDriver webDriver, String username, String password) {
        webDriver.findElement(By.className("login-tab-r")).click();
        webDriver.findElement(By.id("loginname")).sendKeys(username);
        webDriver.findElement(By.id("nloginpwd")).sendKeys(password);
        webDriver.findElement(By.id("loginsubmit")).click();
    }
}
